home *** CD-ROM | disk | FTP | other *** search
- #ifndef __SORTSOLI
- #define __SORTSOLI
- /***************************************************************************
- Author: Mario Westphal
- Copyright ⌐ 1997,98 by Mario M. Westphal
- Version: 1.4.0
-
- Description: Interface definitions for SORTSOL.DLL
- ****************************************************************************/
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #include <windows.h>
-
- //###########################################################################
- // T y p e s
- //###########################################################################
- typedef unsigned long SSIH;
- typedef int SORTSOL_ERROR;
-
-
- //###########################################################################
- // M a x i m a
- //###########################################################################
- #define SOSOMAX_RECLEN 65535 // unsigned short range!!!
- #define SOSOMAX_KEYS 64 // Maximum number of keys
- #define SOSOMAX_KEYLEN 65535 // Maximum keylen in byte
- #define SOSOMAX_THREADS 64 // Maximum Number of threads
- #define SOSOMAX_PREMERGECACHE 128 // Maxmimum number of entries in the pre-merge cache
- #define SOSOMAX_MERGEFILES 64 // Maximum number of merge files
- #define SOSOMIN_SORTMEM 65535 // Minimum memory per thread
- #define SOSOMIN_MERGEMEM 65535 // Minimum memory per thread
- #define SOSOMAX_EXPLICITNUMLEN 5 // Maximum length for explicit length
- #define SOSOMAX_DATETIME_MASK 100 // Maximum length of the date/time mask
- #define SOSOMAX_SEQUENCE_LENGTH 256 // Length of the sequence
- #define SOSOMAX_KEYDLL_NAME 40 // Maximum length of the Compare function name in a key dll
- #define SOSOMAX_USERDATA_LEN 40 // Maximum length for the "Data" parameter for keytype "User"
- #define SOSOMAX_TRAILEREXPR_LEN 40 // Maximum length for the expression in the TRAILER statement
-
- //###########################################################################
- // E r r o r C o d e s
- //###########################################################################
- #define SOSOERR_SUCCESS 0
- #define SOSOERR_FIRST 20000
- #define SOSOERR_UNKNOWN (SOSOERR_FIRST + 1)
-
- // Source file
-
- #define SOSOERR_OPENSOURCE (SOSOERR_FIRST + 2) // Error opening the source file
- #define SOSOERR_READSOURCE (SOSOERR_FIRST + 3) // Error reading from the source file
- #define SOSOERR_SEEKSOURCE (SOSOERR_FIRST + 4) // Error seeking in the source file
- #define SOSOERR_CLOSESOURCE (SOSOERR_FIRST + 5) // Error closing the source
- #define SOSOERR_PARSESOURCE (SOSOERR_FIRST + 6) // Error while parsing the structure of the source file
- #define SOSOERR_INVALIDFORMAT (SOSOERR_FIRST + 7) // Invalid file format
-
- #define SOSOERR_RUNTIME (SOSOERR_FIRST + 8) // Runtime error
- #define SOSOERR_MEMORY (SOSOERR_FIRST + 9) // Out of memory
-
- #define SOSOERR_EXPLICITOFFSET (SOSOERR_FIRST + 10) // Offset wrong
- #define SOSOERR_EXPLICITLEN (SOSOERR_FIRST + 11) // Len > 5
- #define SOSOERR_EXPLICITRECLEN (SOSOERR_FIRST + 12) // Record to short
-
- #define SOSOERR_ABORTED (SOSOERR_FIRST + 18) // User abort
- #define SOSOERR_NORECORDS (SOSOERR_FIRST + 19) // No records found in input file
-
- #define SOSOERR_OPENDEST (SOSOERR_FIRST + 20) // Error opening the destination file
- #define SOSOERR_WRITEDEST (SOSOERR_FIRST + 21) // Error writing to the destination file
- #define SOSOERR_SEEKDEST (SOSOERR_FIRST + 22) // Error seeking in the destination file
- #define SOSOERR_CLOSEDEST (SOSOERR_FIRST + 23) // Error closing the destination file
- #define SOSOERR_DESTNOSPACE (SOSOERR_FIRST + 24) // Not enough space on the destination drive
-
- #define SOSOERR_OPENMERGE (SOSOERR_FIRST + 30) // Error opening a merge file
- #define SOSOERR_READMERGE (SOSOERR_FIRST + 31) // Error reading from a merge file
- #define SOSOERR_WRITEMERGE (SOSOERR_FIRST + 32) // Error writing to a merge file
- #define SOSOERR_SEEKMERGE (SOSOERR_FIRST + 33) // Error seeking in a merge file
- #define SOSOERR_CLOSEMERGE (SOSOERR_FIRST + 34) // Error closing a merge file
- #define SOSOERR_GETMERGEFILENAME (SOSOERR_FIRST + 35) // Error retrieving a merge file name
- #define SOSOERR_NOMERGESPACE (SOSOERR_FIRST + 36) // All merge drives are full
- #define SOSOERR_NOMERGEDRIVESAVAIL (SOSOERR_FIRST + 37) // No merge drives are available
-
- #define SOSOERR_CHECK_SOURCENOTFOUND (SOSOERR_FIRST + 100) // Source file not found
- #define SOSOERR_CHECK_CREATEDEST (SOSOERR_FIRST + 101) // Error creating the destination file
- #define SOSOERR_CHECK_INVALIDMERGEDRIVE (SOSOERR_FIRST + 102) // Invalid merge drive specified
-
- #define SOSOERR_OPENLOG (SOSOERR_FIRST + 120) // Error opening the logfile
- #define SOSOERR_WRITELOG (SOSOERR_FIRST + 121) // Error writing the logfile
-
- #define SOSOERR_NOKEYSDEFINED (SOSOERR_FIRST + 200) // No keys defined
- #define SOSOERR_ERRORCREATEINSTANCE (SOSOERR_FIRST + 201) // Error creating a sort instance
- #define SOSOERR_ERRORINVALIDERRORCODE (SOSOERR_FIRST + 202) // Invalid error code for SSIGetErrorMessage
-
- #define SOSOERR_KEYDLL_NOTFOUND (SOSOERR_FIRST + 300) // User DLL was not found
- #define SOSOERR_KEYDLL_COMPARE_NOTFOUND (SOSOERR_FIRST + 301) // The specified compare function could not be found in the DLL
- #define SOSOERR_KEYDLL_NO_NAME (SOSOERR_FIRST + 302) // The key definition does not contain a valid DLL name
- #define SOSOERR_KEYDLL_NO_COMPARENAME (SOSOERR_FIRST + 303) // The key definition does not contain a valid compare function name
-
- #define SOSOERR_INVALIDMEMORYORPOINTER (SOSOERR_FIRST + 999) // Invalid memory pointer given to one of the API's
-
- // Invalid parameters
-
- #define SOSOERR_PARAM_INVALIDHANDLE (SOSOERR_FIRST + 1000) // Invalid handle given
- #define SOSOERR_PARAM_INVALIDPARAM (SOSOERR_FIRST + 1001) // Invalid parameter
- #define SOSOERR_PARAM_INPUTFILENAME (SOSOERR_FIRST + 1002) // Invalid source filename
- #define SOSOERR_PARAM_OUTPUTFILENAME (SOSOERR_FIRST + 1003) // Invalid destination file name
- #define SOSOERR_PARAM_MERGEDRIVES (SOSOERR_FIRST + 1004) // Invalid merge drive specification
- #define SOSOERR_PARAM_FILETYPE (SOSOERR_FIRST + 1005) // Unknown file type
- #define SOSOERR_PARAM_RECLEN (SOSOERR_FIRST + 1006) // Invalid reclen
- #define SOSOERR_PARAM_DELIMETERS (SOSOERR_FIRST + 1007) // Invalid delimeter specification
- #define SOSOERR_PARAM_FIELDS (SOSOERR_FIRST + 1008) // Fields argument required in key specification
- #define SOSOERR_PARAM_EXPLICITLEN (SOSOERR_FIRST + 1009) // Error in SORTSOL_FTYPE_EXPLICIT filetype
- #define SOSOERR_PARAM_INVALIDKEYTYPE (SOSOERR_FIRST + 1010) // Unknown key type
- #define SOSOERR_PARAM_DATEADJUST (SOSOERR_FIRST + 1011) // Error in date adjust specifier
- #define SOSOERR_PARAM_KEYPOS (SOSOERR_FIRST + 1012) // Invalid key position
- #define SOSOERR_PARAM_KEYOFFSET (SOSOERR_FIRST + 1013) // Invalid key offset
- #define SOSOERR_PARAM_WRONGFORMAT_FOR_KEYTYPE (SOSOERR_FIRST + 1014) // Wrong file format for key type
- #define SOSOERR_PARAM_HEADERSIZE (SOSOERR_FIRST + 1015) // Invalid header size
- #define SOSOERR_PARAM_FILESIZEMISMATCH (SOSOERR_FIRST + 1016) // File site must match record length (SORTSOL_FTYPE_FIXED)
- #define SOSOERR_PARAM_TOMANYKEYS (SOSOERR_FIRST + 1017) // To many keys specified
- #define SOSOERR_PARAM_INVALIDMASK (SOSOERR_FIRST + 1018) // Invalid date/time mask
- #define SOSOERR_PARAM_INVALIDSEQUENCE (SOSOERR_FIRST + 1019) // Invalid sequence
- #define SOSOERR_PARAM_INVALIDKEYLEN (SOSOERR_FIRST + 1020) // Invalid key len
- #define SOSOERR_PARAM_DRIVESPACE (SOSOERR_FIRST + 1021) // Error in CheckDriveSpace statement
-
- #define SOSOERR_VERSIONINFO (SOSOERR_FIRST + 1030) // Error retrieving the version information
-
- // Command file related errors (CreateFromFile() API)
-
- #define SOSOERR_CMDFILENOTFOUND (SOSOERR_FIRST + 2000) // Command file not found
- #define SOSOERR_INVALIDCMDFILENAME (SOSOERR_FIRST + 2001) // Invalid command file name
- #define SOSOERR_OPENCMDFILE (SOSOERR_FIRST + 2002) // Error opening the command file
- #define SOSOERR_UNKNOWNKEYWORD (SOSOERR_FIRST + 2003) // Unknown keyword found
- #define SOSOERR_MISSINGOP (SOSOERR_FIRST + 2004) // Missing "("
- #define SOSOERR_MISSINGCP (SOSOERR_FIRST + 2005) // Missing ")"
- #define SOSOERR_NODRIVES (SOSOERR_FIRST + 2006) // Argument missing in DRIVES statement
- #define SOSOERR_INVALIDDRIVES (SOSOERR_FIRST + 2007) // Invalid DRIVES statement
- #define SOSOERR_DRIVESPARE (SOSOERR_FIRST + 2008) // Invalid DRIVESPARE statement
- #define SOSOERR_THREADS (SOSOERR_FIRST + 2009) // Invalid THREADS statement
- #define SOSOERR_CACHES (SOSOERR_FIRST + 2010) // Invalid CACHES statement
- #define SOSOERR_SORTMEM (SOSOERR_FIRST + 2011) // Invalid SORTMEM statement
- #define SOSOERR_MERGEMEM (SOSOERR_FIRST + 2012) // Invalid MERGEMEM statement
- #define SOSOERR_RANGE (SOSOERR_FIRST + 2013) // Invalid RANGE statement
- #define SOSOERR_FILTER_ARGS (SOSOERR_FIRST + 2014) // Invalid arguments in FILTER statement
- #define SOSOERR_FILTER_TYPE (SOSOERR_FIRST + 2015) // Invalid type in FILTER
- #define SOSOERR_FILTER_FTREMOVE_ARGS (SOSOERR_FIRST + 2016) // Invalid remove sepcifier in FILTER statement
- #define SOSOERR_INPUTFILE (SOSOERR_FIRST + 2017) // Invalid INPUTFILE statement
- #define SOSOERR_INPUTFILEDELETE (SOSOERR_FIRST + 2018) // Invalid delete specifier for INPUTFILE statement
- #define SOSOERR_OUTPUTFILE (SOSOERR_FIRST + 2019) // Invalid OUTPUTFILE statement
- #define SOSOERR_LOGFILE (SOSOERR_FIRST + 2020) // Invalid LOGFILE statement
- #define SOSOERR_COMPRESS (SOSOERR_FIRST + 2021) // Invalid COMPRESS statement
- #define SOSOERR_HEADER (SOSOERR_FIRST + 2022) // Invalid HEADER statement
- #define SOSOERR_HEADERLEN (SOSOERR_FIRST + 2023) // Invalid "length" specifier in HEADER
- #define SOSOERR_HEADER_INBYTES (SOSOERR_FIRST + 2024) // Invalid "in bytes" specifier in HEADER
- #define SOSOERR_HEADER_KEEP (SOSOERR_FIRST + 2025) // Invalid "keep" specifier in HEADER
- #define SOSOERR_FILETYPE_ARGS (SOSOERR_FIRST + 2026) // Invalid arguments for FILETYPE
- #define SOSOERR_FILETYPE_UNKNOWN (SOSOERR_FIRST + 2027) // Unknown FILETYPE
- #define SOSOERR_FILETYPE_INVALIDRECLEN (SOSOERR_FIRST + 2028) // Invalid record length specifier in FILETYPE
- #define SOSOERR_FILETYPE_SEPARATOR (SOSOERR_FIRST + 2029) // Invalid separator
- #define SOSOERR_FILETYPE_DELIMETER (SOSOERR_FIRST + 2030) // Invalid delimeter
- #define SOSOERR_FILETYPE_TOMANYFIELDS (SOSOERR_FIRST + 2031) // SORTSOL_FTYPE_EXPLICIT: To many fields specified
- #define SOSOERR_FILETYPE_EXINVALIDOFS (SOSOERR_FIRST + 2032) // SORTSOL_FTYPE_EXPLICIT: Invalid offset
- #define SOSOERR_FILETYPE_EXINVALIDLEN (SOSOERR_FIRST + 2033) // SORTSOL_FTYPE_EXPLICIT: Invalid length
- #define SOSOERR_FILETYPE_EXINVALIDBINSPEC (SOSOERR_FIRST + 2034) // SORTSOL_FTYPE_EXPLICIT) Invalid "binary" specifier
- #define SOSOERR_KEY_ARGS (SOSOERR_FIRST + 2035) // Invalid arguments found in KEY
- #define SOSOERR_KEY_INVALIDTYPE (SOSOERR_FIRST + 2036) // Invalid KEY type
- #define SOSOERR_KEY_INVALIDSORTORDER (SOSOERR_FIRST + 2037) // Unknown "sort order" specifier
- #define SOSOERR_KEY_INVALIDPOS (SOSOERR_FIRST + 2038) // Invalid "position" specifier
- #define SOSOERR_KEY_INVALIDOFS (SOSOERR_FIRST + 2039) // Invalid "offset" specifier
- #define SOSOERR_KEY_INVALIDLEN (SOSOERR_FIRST + 2040) // Invalid "length" specifier
- #define SOSOERR_KEY_INVALIDDECPL (SOSOERR_FIRST + 2041) // Invalid "decimal places" specifier
- #define SOSOERR_KEY_MASKTOLONG (SOSOERR_FIRST + 2042) // Date/time mask too long
- #define SOSOERR_KEY_MASKTOSHORT (SOSOERR_FIRST + 2043) // Date/time mask too shoort
- #define SOSOERR_KEY_SEQUENCETOSHORT (SOSOERR_FIRST + 2044) // Sequence less than 256 byte
- #define SOSOERR_KEY_PRIMLANG (SOSOERR_FIRST + 2045) // Unknown primary language
- #define SOSOERR_KEY_SUBLANG (SOSOERR_FIRST + 2046) // Unknown sub-language
- #define SOSOERR_KEY_DATEADJUST (SOSOERR_FIRST + 2047) // Invalid "date adjust" specifier
- #define SOSOERR_PRIORITY (SOSOERR_FIRST + 2048) // Invalid priority
- #define SOSOERR_OUTPUTFILEAPPEND (SOSOERR_FIRST + 2049) // TRUE to append to an existing output file
- #define SOSOERR_KEYDLL_DATAOUTOFRANGE (SOSOERR_FIRST + 2050) // "Data" to long in User key
-
- #define SOSOERR_PARAM_TRAILER_WRONGTYPE (SOSOERR_FIRST + 2070) // Wrong type in TRAILER statement
- #define SOSOERR_PARAM_TRAILER_KEEP (SOSOERR_FIRST + 2071) // Invalid "keep" specifier in TRAILER
- #define SOSOERR_PARAM_TRAILER_EXPR_TOO_LONG (SOSOERR_FIRST + 2072) // Expression in TRAILER exceeds SOSOMAX_TRAILEREXPR_LEN
- #define SOSOERR_PARAM_TRAILER_LEN (SOSOERR_FIRST + 2073) // Length in TRAILER invalid
-
- #define SOSOERR_TRAILER_LEN (SOSOERR_FIRST + 2080) // TRAILER size bigger than input file size
- #define SOSOERR_TRAILER_SAVETEMP (SOSOERR_FIRST + 2081) // Error while saving the TRAILER to a temporary file
- #define SOSOERR_TRAILER_READTEMP (SOSOERR_FIRST + 2082) // Error while reading the TRAILER from a temporary file
- #define SOSOERR_TRAILER_READINPUT (SOSOERR_FIRST + 2083) // Error while parsing the input file for the trailer
-
- //###########################################################################
- // F i l e T y p e s
- //###########################################################################
- #define SORTSOL_FTYPE_FIXED 0 // Fixed length records: each record has the same length
- #define SORTSOL_FTYPE_DELIMITED 1 // Delimeted file: each record is delimeted with a character or pair of characters
- #define SORTSOL_FTYPE_COUNTED 2 // Counted file, consisting of fields separated by a character, each record contains the same number of fields
- #define SORTSOL_FTYPE_EXPLICIT 3 // File with explicit record length; each record contains an explicit length field in the first n bytes
-
-
- //###########################################################################
- // F i l t e r s
- //###########################################################################
- #define SORTSOL_FILTER_REMOVEDUPL_RECORD 0 // Remove duplicate records
- #define SORTSOL_FILTER_REMOVEDUPL_KEY 1 // Remove based on key comparison
-
-
- //###########################################################################
- // N o t i f i c a t i o n s
- //###########################################################################
-
- #define SORTSOL_NOTIFY_SORTPERCENTAGE 1 // The sort percentage is updated
- #define SORTSOL_NOTIFY_MERGEPERCENTAGE 2 // The merge percentage is updated
- #define SORTSOL_NOTIFY_BEGINSORT 3 // The sort begins
- #define SORTSOL_STATUS_ONEPHASESORT 1 // In-memory sort
- #define SORTSOL_STATUS_MERGESORT 2 // Mergesort
- #define SORTSOL_NOTIFY_FINISHSORT 4 // The sort is finished
- #define SORTSOL_NOTIFY_BEGINMERGE 5 // The merge begins
- #define SORTSOL_NOTIFY_FINISHMERGE 6 // The merge is finished
- #define SORTSOL_NOTIFY_FINISHED 20 // The complete sort is finished
-
- // The notifications callback
- typedef BOOL (CALLBACK* SORTSOL_NOTIFYCALLBACK)(UINT Code, DWORD StatusData, DWORD Extra);
-
-
- //###########################################################################
- // S u p p o r t e d K e y T y p e s
- //###########################################################################
-
- #define SORTSOL_KEY_Generic 0
- #define SORTSOL_KEY_String 1
- #define SORTSOL_KEY_StringN 2
- #define SORTSOL_KEY_StringNLS 3
- #define SORTSOL_KEY_StringNLSN 4
- #define SORTSOL_KEY_ShortInt 5
- #define SORTSOL_KEY_UShortInt 6
- #define SORTSOL_KEY_LongInt 7
- #define SORTSOL_KEY_ULongInt 8
- #define SORTSOL_KEY_LongInt64 9
- #define SORTSOL_KEY_ULongInt64 10
- #define SORTSOL_KEY_Float 11
- #define SORTSOL_KEY_Double 12
- #define SORTSOL_KEY_LDouble 13
- #define SORTSOL_KEY_IntS 14
- #define SORTSOL_KEY_UIntS 15
- #define SORTSOL_KEY_IntS64 16
- #define SORTSOL_KEY_UIntS64 17
- #define SORTSOL_KEY_DoubleS 18
- #define SORTSOL_KEY_FixDecimal 19
- #define SORTSOL_KEY_Date 20
- #define SORTSOL_KEY_Time 21
- #define SORTSOL_KEY_UDS 22
- #define SORTSOL_KEY_UserKey 23
-
- // Maximum number of keys (highest index)
- #define SORTSOL_KEY_MAX 23
-
-
- //###########################################################################
- // S t r u c t u r e s
- //###########################################################################
-
- #pragma pack(1)
-
- // INTERNAL USE ONLY
- // Information about the sorted file
- typedef struct tagSORTSOL_FILEINFO
- {
- unsigned int uSize; // Size of this structure
- int nType; // FILETYPE
- BOOL bKeepHeader; // Keep the header?
- UINT uHeaderElements; // Number of elements in the header
- BOOL bHeaderInByte; // TRUE => in byte, else in records
- USHORT uTrailerType; // Type of the trailer (0 = none, 1 = Count, 2 = Parse)
- char cTrailerExpr[SOSOMAX_TRAILEREXPR_LEN+1];// The text that defines the "EOF"
- int nTrailerSize; // Number of bytes in the trailer
- BOOL bKeepTrailer; // Move the trailer into the output file?
- USHORT uRecLen; // Record lengh (SORTSOL_FTYPE_FIXED)
- USHORT uFields; // Number of fields (SORTSOL_FTYPE_EXPLICIT)
- USHORT uExplicitLen; // Length of the explicit length specifier
- USHORT uExplicitOffset; // Offset of the explicit length specifier
- BOOL bExplicitIBinary; // Is the explicit length specifier binary?
- char cSeparator; // Field separator
- UINT uNoOfDelimeters; // Number of characters in Delimeters
- char Delimeters[2]; // Maximum two delimeters
- } SORTSOL_FILEINFO;
-
-
- // INTERNAL USE ONLY
- // This structure defines the information required by the sort functions
- typedef struct tagSORTSOL_SORTINFO
- {
- unsigned int uSize; // The size in byte of this structure
- TCHAR cInputFileName[MAX_PATH]; // The name of the input file
- TCHAR cOutputFileName[MAX_PATH]; // The name of the output file
- BOOL bAppendOutput; // TRUE to append to an existing output file
- TCHAR cLogFileName[MAX_PATH]; // The name of the logfile
- BOOL bAppendLog; // TRUE if the new log is appended if the logfile exists
- TCHAR cMergeDrives[100]; // List of merge drives
- USHORT nNumberOfThreads; // Number of threads
- USHORT nCacheEntries; // Number of pre-merge caches
- DWORD dwSortMemory; // Memory in byte per thread
- DWORD dwMergeMemory; // Memory in byte for the merge
- BOOL bUseCompression; // Use compression for the merge files (Windows NT / NTFS only)
- BOOL bCompressOutput; // Use compression for the output file (Windows NT / NTFS only)
- BOOL bDeleteInput; // TRUE => delete the input file after sorting
- DWORD dwDriveSpare; // Drive spare factor
- BOOL bSkipDriveSpaceCheck; // Skip the drive space check
- DWORD dwRange; // Output range
- SORTSOL_FILEINFO FileInfo; // File format information (see above)
- } SORTSOL_SORTINFO;
-
-
- // INTERNAL USE ONLY
- // This structure contains all information required to describe a key
- typedef struct tagSORTSOL_KEYDEF
- {
- unsigned int uSize; // size of this structure in byte
- int nType; // KEY type
- BOOL bAscending; // TRUE: Ascending, else Descending
- USHORT uKeyLen; // Key length
- USHORT uKeyOffset; // Key offset
- USHORT uKeyPos; // Key position
- LCID Locale; // Locale identifier for NLS keys
- char cDecimalPointChar; // Char for the decimal point
- int nTwoDigitDateAdjust; // Date adjust value
- USHORT uDecimalPlaces; // Number of decimal places
- char cSequence[SOSOMAX_SEQUENCE_LENGTH]; // Sequence
- char cMask[SOSOMAX_DATETIME_MASK]; // Date/time mask
- char cKeyDLL[MAX_PATH]; // Name of the Key-DLL
- char cKeyName[SOSOMAX_KEYDLL_NAME]; // Name of the Compare function
- char cUserData[SOSOMAX_USERDATA_LEN]; // Extra data passed to a "User" key
- } SORTSOL_KEYDEF;
-
-
- // This structure is used with SSIGetStats() to query
- // sort statistics
- typedef struct tagSORTSOL_STATS
- {
- unsigned int uSize; // size of this structure in byte
- LARGE_INTEGER liBytesSorted; // Number of bytes sorted
- DWORD dwSortTime; // Time in ms for the sort
- DWORD dwMergeTime; // Time in ms for the merge
- DWORD dwAvgBlockLoadTime; // Average time for loading a run in ms
- DWORD dwAvgBlockSortTime; // Average time to sort a run in ms
- DWORD dwAvgBlockMergeTime; // Average time for pre-merge
- LARGE_INTEGER liRecordsProcessed; // Number of records processed
- LARGE_INTEGER liRecordsFiltered; // Number of records filtered
- DWORD dwNumberOfRuns; // Number of runs to merge
- DWORD dwCachePerRun; // Cache size in byte per run
- } SORTSOL_STATS;
-
-
- // This structure is used by SSICreateFromFile and SSICreateFromCommandString
- // to transport data into and from the functions
- typedef struct tagSORTSOL_CMDFILESTATUS
- {
- unsigned int uSize; // size of this structure in byte
- int LineNo; // OUT: Line where the error occured
- TCHAR ErrLine[256]; // OUT: The raw content of the line
- BOOL Override; // IN: TRUE if the members of this structure override settings from the profile
- TCHAR InputFileName[MAX_PATH]; // IN/OUT: The name of the input file
- BOOL DeleteInput; // IN/OUT: TRUE if the input file is deleted after the sort
- TCHAR OutputFileName[MAX_PATH]; // IN/OUT: The name of the destination file
- BOOL AppendOutput; // IN/OUT: TRUE if new data is appended to the output file
- TCHAR LogFileName[MAX_PATH]; // IN/OUT: The name of the logfile
- BOOL AppendLog; // IN: TRUE if new data should be appended to the log file
- DWORD PriorityClass; // OUT: The PRIORITY-setting from the command file
-
- } SORTSOL_CMDFILESTATUS;
-
- #pragma pack()
-
- //###########################################################################
- // E x p o r t e d F u n c t i o n s
- //###########################################################################
-
- SORTSOL_ERROR WINAPI SSICreateFromFile(SSIH* pHandle, LPCTSTR Filename, SORTSOL_CMDFILESTATUS* pStatus);
- SORTSOL_ERROR WINAPI SSICreateFromCommandString(SSIH* pHandle, LPCTSTR Commands, SORTSOL_CMDFILESTATUS* pStatus);
-
- SORTSOL_ERROR WINAPI SSISort(SSIH Handle);
- SORTSOL_ERROR WINAPI SSIFree(SSIH Handle);
-
- SORTSOL_ERROR WINAPI SSIRegisterCallback(SSIH Handle, SORTSOL_NOTIFYCALLBACK lpCallback, DWORD Extra);
-
- SORTSOL_ERROR WINAPI SSIGetStats(SSIH Handle, SORTSOL_STATS* pStats);
- SORTSOL_ERROR WINAPI SSIGetErrorMessage(SORTSOL_ERROR ErrorCode, LPTSTR lpBuffer, DWORD* nSize);
- SORTSOL_ERROR WINAPI SSIGetVersion(DWORD* pVNMS, DWORD* pVNLS);
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif // __SORTSOLI
-